@import '../../style/theme/color';
@import '../../style/theme/shadow';
@import '../../style/theme/corner';

:host {
  display: block;
}

.devui-gantt-bar {
  position: relative;
  width: 100%;
  cursor: pointer;
  box-sizing: border-box;
  height: 24px;
  z-index: 3;

  .devui-gantt-main {
    cursor: move;

    &.disabled {
      cursor: not-allowed;
    }
  }

  .devui-gantt-bar-rail {
    position: absolute;
    background: $devui-initial;
    box-shadow: $devui-shadow-length-base rgba(81, 112, 255, 0.19); // TODO: color not variable
    height: 20px;
    margin-top: 2px;
    width: 100%;
    border-radius: $devui-border-radius;

    &.disabled {
      background-color: $devui-area;
    }
  }

  & .devui-gantt-hover-layer {
    display: none;
    position: absolute;
    height: 24px;
    left: -12px;
    border-radius: $devui-border-radius;
    background-color: $devui-connected-overlay-bg;
    box-shadow: $devui-shadow-length-hover rgba(81, 112, 255, 0.3); // TODO: color not variable

    & .devui-gantt-dragger {
      position: absolute;
      width: 12px;
      height: 24px;
      cursor: col-resize;

      &.left {
        left: 0;
      }

      &.right {
        right: 0;
      }

      & .handle {
        width: 2px;
        height: 14px;
        background: $devui-icon-fill;
        border-radius: $devui-border-radius;
        margin: 5px 5px;

        &.disabled {
          cursor: not-allowed;
        }
      }
    }
  }

  .devui-gantt-bar-track {
    position: absolute;
    background-color: $devui-brand;
    box-shadow: $devui-shadow-length-base rgba(81, 112, 255, 0.4);
    border-radius: $devui-border-radius 0 0 $devui-border-radius;
    border-radius: $devui-border-radius 0 0 $devui-border-radius;
    height: 20px;
    margin-top: 2px;
    width: 0;
  }

  .devui-gantt-bar-progress {
    display: none;
    position: absolute;
    left: 0;
    bottom: -8px;
    margin-left: -6px;
    cursor: pointer;

    & > svg {
      display: block;

      & > g > path {
        fill: $devui-icon-bg;
        stroke: $devui-icon-fill-active;
      }
    }

    &.visible {
      display: block;
    }

    &.disabled {
      cursor: not-allowed;
    }
  }

  &:hover .devui-gantt-bar-progress {
    display: block;
  }

  .devui-gantt-bar-title {
    position: absolute;
    display: inline-flex;
    align-items: center;
    left: 100%;
    height: 100%;
    margin-left: 12px;
    word-break: keep-all;
  }
}

.devui-gantt-tips {
  width: 280px;
  min-height: 100px;
  background: $devui-base-bg;
  box-shadow: $devui-shadow-length-feedback-overlay rgba(81, 112, 255, 0.1);
  border-radius: $devui-border-radius-card;
  padding: 15px;
  margin-top: 10px;
}

.moving-bg {
  position: absolute;
  height: 100%;
  top: 0;
  bottom: 0;
  background: $devui-float-block-shadow;
  opacity: 0.3;
}
